<?php
/** 获得磁盘空间信息 */
$dir = strpos(__ROOT__, ':') === 1 ? substr(__ROOT__, 0, 2) : '/';
$free = round(disk_free_space($dir)/1024/1024);
if($free >= 1024){
	$freeSpace = round($free/1024).'GB(可用)';
}else{
	$freeSpace = $free.'MB(可用)';
}
$total = round(disk_total_space($dir)/1024/1024);
if($total >= 1024){
	$totalSpace = round($total/1024).'GB(总共)';
}else{
	$totalSpace = $total.'MB(总共)';
}

/** 上传限制 */
$uploadLimit = floor(config('file.upload.maxSize')/1024).'MB(本地) / '.ini_get('post_max_size').'B(服务器)';

/** MySQL 已用空间 */
$MySQLUsed = mysql::dbname('information_schema')->query("select concat(round(sum(data_length/1024/1024),2),'MB') as size from tables where table_schema='".config('mod.database.name')."';")->fetch_object()->size;
mysql::dbname(config('mod.database.name'));